<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="adminTemplate.xhtml">

    <ui:define name="contentAdmin">
        <br/><br/><h:outputLink value="userList.jsf"> <h:outputText value="Back"/>  </h:outputLink>
        <h1>Edit User</h1>
        <h:messages showDetail="true"/>
        <h:form>
            <h:panelGrid columns="3">

              <!-- Login -->
                <h:outputLabel for="login">
                    <h:outputText value="Login: "/>
                </h:outputLabel>
                <h:outputText id="login" value="#{editUsers.userSelectedForEdit.login}"/>

              <!-- Password -->
                 <h:outputLabel for="password">
                    <h:outputText value="Password: "/>
                </h:outputLabel>
                <h:inputText id="password" value="#{editUsers.userSelectedForEdit.password}" required="true"/>
              <!-- First Name -->
                <h:outputLabel for="fname">
                    <h:outputText value="First Name: "/>
                </h:outputLabel>
                <h:inputText id="fname"  value="#{editUsers.userSelectedForEdit.firstName}" required="true"/>

              <!-- Last Name -->
                <h:outputLabel for="lname">
                    <h:outputText value="Last Name: "/>
                </h:outputLabel>
                <h:inputText id="lname"  value="#{editUsers.userSelectedForEdit.lastName}" required="true"/>

              <!-- Group -->
                <h:outputLabel for="group" value="Group: "/>
                <h:selectOneMenu id="group" value="#{editUsers.groupSelected}">
                           <f:selectItems value="#{editUsers.availableGroups}" />
                </h:selectOneMenu>
              <!-- Enabled -->
                <h:outputLabel for="enabled">
                    <h:outputText value="Enabled: "/>
                </h:outputLabel>
                <h:selectBooleanCheckbox id="enabled"  value="#{editUsers.userSelectedForEdit.enabled}"/>

              <!--Description -->
                <h:outputLabel for="description">
                    <h:outputText value="Description: "/>
                </h:outputLabel>
                <h:inputTextarea id="description"  value="#{editUsers.userSelectedForEdit.description}"/>

              <!-- Buttons -->
                <h:commandButton value="Update User" action="#{editUsers.update}"/>
                <h:commandButton type="reset" value="Reset"/>
            </h:panelGrid>
        </h:form>
    </ui:define>

</ui:composition>